<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/AdminTemplate.xhtml">
        <ui:define name="page">
            <body>
                <table width="100%" border="0" cellspacing="1">
                    <tr>

                        <td align="center"> <h:form>
                            <h1> Options payantes </h1>
                            <p:dataTable value="#{adminLogin.listeOptionPayante}"
                                             var="option" id="Toption" cellspacing="0" dynamic="true"
                                             paginator="true" paginatorPosition="bottom" rows="10"
                                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                             rowsPerPageTemplate="5,10,15">
<!--                            <h:dataTable value="#{adminLogin.listeOptionPayante}" var="option" id="Toption"  cellspacing="0">-->
                                <p:column>
                                    <f:facet name="header">nom</f:facet>
				    #{option.nom}
                                </p:column>
                                <p:column>

                                    <f:facet name="header">prix</f:facet>
				    #{option.prix}
                                </p:column>
                                <p:column>
                                    <f:facet name="header">durée de vie</f:facet>
				    #{option.dureedevie}
                                </p:column>
                                <p:column>
                                    <f:facet name="header">description</f:facet>
				    #{option.description}
                                </p:column>
                                <p:column>
                                    <h:form>
                                        <h:commandLink value="Supprimer" action="#{adminLogin.deleteOptionPayante}">
                                            <f:setPropertyActionListener target="#{adminLogin.actionid}" value="#{option.id}" />
                                        </h:commandLink>
                                    </h:form>
                                </p:column>

                                <p:column>
                                    <!--                                    <a href="OptionPayanteModifierPrix.jsf">Modifier prix</a>-->

                                    <h:form>
                                        <h:commandLink value="Modifier prix" action="OptionPayanteModifierPrix.jsf">
                                            <f:setPropertyActionListener target="#{adminLogin.actionid}" value="#{option.id}" />
                                            <f:setPropertyActionListener target="#{adminLogin.optionpay.id}" value="#{option.id}" />
                                            <f:setPropertyActionListener target="#{adminLogin.optionpay.nom}" value="#{option.nom}" />
                                            <f:setPropertyActionListener target="#{adminLogin.optionpay.dureedevie}" value="#{option.dureedevie}" />
                                            <f:setPropertyActionListener target="#{adminLogin.optionpay.description}" value="#{option.description}" />
                                            <f:setPropertyActionListener target="#{adminLogin.optionpay.prix}" value="#{option.prix}" />

                                        </h:commandLink>
                                    </h:form>
                                </p:column>
                                <p:column>
                                    <h:form>
                                        <h:commandLink value="Modifier duree de vie" action="OptionPayanteModifierDuree.jsf">
                                            <f:setPropertyActionListener target="#{adminLogin.actionid}" value="#{option.id}" />
                                            <f:setPropertyActionListener target="#{adminLogin.optionpay.id}" value="#{option.id}" />
                                            <f:setPropertyActionListener target="#{adminLogin.optionpay.nom}" value="#{option.nom}" />
                                            <f:setPropertyActionListener target="#{adminLogin.optionpay.dureedevie}" value="#{option.dureedevie}" />
                                            <f:setPropertyActionListener target="#{adminLogin.optionpay.description}" value="#{option.description}" />
                                            <f:setPropertyActionListener target="#{adminLogin.optionpay.prix}" value="#{option.prix}" />

                                        </h:commandLink>
                                    </h:form>
                                    <!--                                    <a href="OptionPayanteModifierDuree.jsf">Modifier duree de vie</a>-->
                                </p:column>
                            </p:dataTable>
                            </h:form>
<!--                            </h:dataTable>-->
                            <br /><br />
                        </td>
                    </tr>
                </table>
            </body>
        </ui:define>
    </ui:composition>
</html>
